#ifndef __NET_STRUCT_H__
#define __NET_STRUCT_H__

#include "../ReflectJson.hpp"


#define PARAMETERS int code; std::string msg;
#define EXPANDCALL code, msg

struct TestReq
{
    int id;
    std::string name;
    std::vector<std::string> tags;
    std::map<std::string, int> scores;

    REFLECT(id, name, tags, scores);
};
struct TestAck
{
    PARAMETERS

    REFLECT(EXPANDCALL);
};

//获取验证码
struct GetVerificationCodeReq
{
    std::string email;
    REFLECT(email);
};
struct GetVerificationCodeAck
{
    PARAMETERS
    std::string email;

    REFLECT(EXPANDCALL, email);
};

//用户注册 - 修改密码
struct UserRegisterReq
{
    std::string username;
    std::string email;
    std::string password;
    std::string verificationCode;

    REFLECT(username, email, password, verificationCode);
};
struct UserRegisterAck
{
    PARAMETERS

    REFLECT(EXPANDCALL);
};

//用户登录
struct UserLoginReq
{
    std::string email;
    std::string password;

    REFLECT(email, password);
};
struct UserLoginAck
{
    PARAMETERS
    std::string token;
    std::string host;
    std::string port;
    uint32_t id;

    REFLECT(EXPANDCALL, token, host, port, id);
};

#endif // !__NET_STRUCT_H__